from src.storage import load_from_file
from src.core import create_item,delete_item,display_items
from src.ui.console import display_menu

def main():
    """Load file and main loop"""
    items=load_from_file()
    print("===TFboys' Bakery===")
    print(f"Items:{len(items)}")

    while True:
        display_menu()
        choice=input("Enter the number(1-4):")
        if choice=="1":
            create_item(items)
        elif choice=="2":
            display_items(items)
        elif choice=="3":
            item_id = input("Enter the ID of bread you want to delete:")
            delete_item(items,item_id)
        elif choice=="4":
            print("\n Goodbye!")
            break
        else:
             print("Invalid!Please enter the number between 1-4.")
        

if __name__=="__main__":
        main()

        

    

        